<?php

include_once(dirname(__FILE__)."/../../src/TemplateGenerator.php");


if (isset($_POST['upload'])) {  
    if (!empty($_FILES['my_file'])) { 
			//check for image submitted
    		if ($_FILES['my_file']['error'] > 0) { 
			// check for error re file
            echo "Error: " . $_FILES["my_file"]["error"] ;
        } else {
			//move temp file to our server            
			//move_uploaded_file($_FILES['my_file']['tmp_name'], $upload_directory . $_FILES['my_file']['name']);
			
            $template_gen = new TemplateGenerator();          
			$template_gen->createTemplate($_FILES['my_file']['tmp_name'],$_FILES['my_file']['name'],dirname(__FILE__)."/../../templates/");
				
			//echo 'Uploaded File.';
        }
    } else {
	        //die('File not uploaded.'); 
			// exit script
    }
}
?>